import requests

url = 'https://www.baidu.com'

response = requests.get(url=url)

# response 类型
print(type(response))

# 修改返回类型的编码
response.encoding = 'utf-8'

# 以字符串的形式返回网页的源码
print(response.text)

# 获取请求路径
print(response.url)

# 返回是二进制的数据
print(response.content)

# 返回的是响应头
print(response.headers)


